LOGIC BUILDER NAME EDIT FIX Copy

Documentation for Plans

๐Ÿ”ง Logic Builder - Flow Name Editing Fix

Date: October 12, 2025
Status: โœ… FIXED
Severity: HIGH (User Experience)


๐Ÿ› The Problem

Flow name editing was broken in the Logic Builder. When clicking the flow name to edit it, the input field would appear but changes wouldn't be saved properly.


๐Ÿ” Root Cause

The template was using two-way binding [(ngModel)] with a signal, which doesn't work in Angular:

<!-- โŒ BROKEN: Two-way binding with signal -->
<input
  type="text"
  class="flow-name-input"
  [(ngModel)]="currentFlowName"
  ...
/>

Problem: currentFlowName is defined as a signal:

readonly currentFlowName = signal<string>('Untitled Flow');

Why it breaks: Angular's two-way binding [(ngModel)] expects a regular property, not a signal. Signals have a different API (.set() and () for reading).


โœ… The Fix

Changed to use one-way binding with manual signal updates:

<!-- โœ… FIXED: One-way binding + manual signal update -->
<input
  type="text"
  class="flow-name-input"
  [ngModel]="currentFlowName()"
  (ngModelChange)="currentFlowName.set($event)"
  (blur)="finishEditingFlowName()"
  (keydown.enter)="finishEditingFlowName()"
  (keydown.escape)="cancelEditingFlowName()"
  ...
/>

How it works:

  1. [ngModel]="currentFlowName()" - Read the current value from the signal
  2. (ngModelChange)="currentFlowName.set($event)" - Update the signal when the input changes
  3. Other events (blur, enter, escape) still work as before

๐Ÿงช How to Test

  1. Open Logic Builder (/singularity/logic-builder)
  2. Click on the flow name (e.g., "Untitled Flow")
  3. Input field appears - Type a new name (e.g., "My Amazing Flow")
  4. Press Enter or click outside the input
  5. Flow name updates โœ…
  6. Save flow - Name persists after save
  7. Reload page - Name is still there

Test Keyboard Shortcuts


๐Ÿ“Š Impact

Action Before After
Click flow name โœ… Input appears โœ… Input appears
Type new name โŒ Doesn't update โœ… Updates in real-time
Press Enter โŒ Name lost โœ… Name saved
Save flow โŒ Old name saved โœ… New name saved

๐Ÿ“ File Changed


๐ŸŽ“ Lesson Learned

Signals vs Two-Way Binding

When working with Angular signals in templates:

โŒ DON'T use two-way binding:

<input [(ngModel)]="mySignal" />  <!-- Won't work! -->

โœ… DO use one-way binding + event:

<input 
  [ngModel]="mySignal()" 
  (ngModelChange)="mySignal.set($event)" 
/>

Or use the new signal input syntax (Angular 17+):

// In component
readonly myValue = signal('');

// In template
<input [(ngModel)]="myValue" />  <!-- Works with model() signals -->

๐Ÿ”— Related Issues

This is a common pattern issue when migrating to signals. Any time you see:

Check if you're using [(ngModel)] with a signal instead of a regular property.


Status: โœ… FIXED - READY TO USE

Flow name editing now works correctly with signals! ๐ŸŽ‰